package com.qiyu.mall.user.provider.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.qiyu.mall.user.provider.entity.WorkerPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author idea
 * @data 2020/1/23
 */
@Mapper
public interface WorkerDao extends BaseMapper<WorkerPO> {

    @Select("select * from t_worker")
    List<WorkerPO> selectAll();

    @Select({"<script>" +
                    "select * from t_worker where worker_id in " +
                    "<foreach item = 'item' index = 'index' collection = 'ids' open='(' separator=',' close=')'>" +
                    "#{item}" +
                    "</foreach>" +
             "</script>"})
    List<WorkerPO> batchQuery(@Param("ids") List<Integer> workerIdList);
}
